import request from '@/utils/request'
import { dataModulePrefix, codeModulePrefix } from '../../config'

export const getGytdsjPage = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj/page`,
    method: 'post',
    data
  })
}

export const save = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj-temp/save`,
    method: 'post',
    data
  })
}

export const update = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj-temp/update`,
    method: 'post',
    data
  })
}

export const getUser = (id) => {
  return request({
    url: `${dataModulePrefix}/zc-gyyhsj/get/${id}`,
    method: 'get'
  })
}

export const tdxzPage = (data) => {
  return request({
    url: `${codeModulePrefix}/dm-tdxzbm/page`,
    method: 'post',
    data
  })
}

// 运行高压停电用户添加 临时保存
export const addBatch = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdyh-temp/addBatch`,
    method: 'post',
    data
  })
}
// 运行高压临时数据清除
export const clearData = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj-temp/clear`,
    method: 'post',
    data
  })
}
// /yx-gytdyh-temp/page

// /yx-gytdyh/page 运行高压停电用户停电用户列表查询
export const tdyhPageData = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdyh-temp/page`,
    method: 'post',
    data
  })
}
// 保存 运行高压停电事件添加 /yx-gytdsj/saveAll
export const saveAll = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj/saveAll`,
    method: 'post',
    data
  })
}

// /yx-gytdsj-temp/update运行高压停电临时事件修改
export const formDataUpdate = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj-temp/update`,
    method: 'post',
    data
  })
}
// /yx-gytdsj/deleteBatch运行高压停电事件批量删除
export const deleteBatch = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj/deleteBatch`,
    method: 'post',
    data
  })
}

// /yx-gytdyh-temp/deleteBatch运行高压停电用户批量删除
export const deleteUserBatch = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdyh-temp/deleteBatch`,
    method: 'post',
    data
  })
}

// /yx-gytdyh-temp/update运行高压停电用户修改
export const tdUserChange = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdyh-temp/update`,
    method: 'post',
    data
  })
}

// /yx-gytdsj-temp/checkToken验证数据是否正在维护
export const checkToken = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj-temp/checkToken`,
    method: 'post',
    data
  })
}
// /yx-gytdsj-temp/get/{id}根据高压运行停电事件ID查询停电事件数据
export const getEventData = (id) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj-temp/get/${id}`,
    method: 'get'
  })
}

// /yx-gytdsj/update运行高压停电事件修改
export const updateChange = (data) => {
  return request({
    url: `${dataModulePrefix}/yx-gytdsj/update`,
    method: 'post',
    data
  })
}
